//一个模块一个js文件
//user.js代表用户模块

import axios from '../utils/request'

//增删改查的请求方法
export const getUserList=query =>{
    return axios({
        url:'api/User/UsersList',
        method:'get',
        params:query  //params  ？请求参数传参
    })
}
export const addUser=d=>{
    return axios({
        url:'api/User/AddUser',
        method:'post',
        data:d,  //body请求体传参
        timeout:6000
    })
}
export const delUser=del=>{
    return axios({
        url:'api/User/DeleteUser',
        method:'post',
        data:del
    })
}
//批量删除
export const batchuser = del => {
    return axios({
        url: 'api/User/BatchUser',
        method: 'get',
        params: del
    })
}
export const updUser=upd=>{
    return axios({
        url: 'api/User/UpdUser',
        method: 'put',
        data: upd,  //body请求体传参
        timeout: 6000
    })
}
//登录
export const loginUser=d=>{
    return axios({
        url:'api/User/Login',
        method:'post',
        data:d //用请求体传参
    })
}
//刷新token
export const sxtoken=d=>{
    return axios({
        url: 'api/User/GetNewToken',
        method: 'get',
        data: d //用请求体传参
    })
}
//用户反填
export const fanduser=d=>{
     return axios({
         url:'api/User/FindUser',
         method: 'get',
         params: d, //用请求体传参
         responseType:'blob'//必须指定blob
     })
}
//日志导出
export const exportLogs = d => {
    return axios({
        url: 'api/SysLogs/Export',
        method: 'get',
        params: d, //用请求体传参
       //用请求体传参
    })
}